package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Harvests generated by hbm2java
 */
@Entity
@Table(name="harvests"
    ,catalog="madr_bd10"
)
public class Harvests  implements java.io.Serializable {


     private Integer idHar;
     private HarvestMethods harvestMethods;
     private ProductionEvents productionEvents;
     private Date dateHar;
     private String commentHar;
     private Set productions = new HashSet(0);

    public Harvests() {
    }

	
    public Harvests(ProductionEvents productionEvents, Date dateHar) {
        this.productionEvents = productionEvents;
        this.dateHar = dateHar;
    }
    public Harvests(HarvestMethods harvestMethods, ProductionEvents productionEvents, Date dateHar, String commentHar, Set productions) {
       this.harvestMethods = harvestMethods;
       this.productionEvents = productionEvents;
       this.dateHar = dateHar;
       this.commentHar = commentHar;
       this.productions = productions;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_har", unique=true, nullable=false)
    public Integer getIdHar() {
        return this.idHar;
    }
    
    public void setIdHar(Integer idHar) {
        this.idHar = idHar;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="method_har")
    public HarvestMethods getHarvestMethods() {
        return this.harvestMethods;
    }
    
    public void setHarvestMethods(HarvestMethods harvestMethods) {
        this.harvestMethods = harvestMethods;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_production_event_har", nullable=false)
    public ProductionEvents getProductionEvents() {
        return this.productionEvents;
    }
    
    public void setProductionEvents(ProductionEvents productionEvents) {
        this.productionEvents = productionEvents;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="date_har", nullable=false, length=19)
    public Date getDateHar() {
        return this.dateHar;
    }
    
    public void setDateHar(Date dateHar) {
        this.dateHar = dateHar;
    }
    
    @Column(name="comment_har", length=65535)
    public String getCommentHar() {
        return this.commentHar;
    }
    
    public void setCommentHar(String commentHar) {
        this.commentHar = commentHar;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="harvests")
    public Set getProductions() {
        return this.productions;
    }
    
    public void setProductions(Set productions) {
        this.productions = productions;
    }




}


